var str = "fsadfasdfasdfasdfasd127.0.0.1fsadfasdfasdfasfsdfasdfas"
+"fsa192.168.1.101fsdafasdfsadfsadffgaafdssda function dd(){}fsdfsadfasfunction aa(){}dfas";
var reg1 = /\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/g;

var reg2 = /function\s+\w+\(\){}/g

var aa = str.match(reg2)
console.log(str.match(reg1));
console.log(aa);
